/*
 * @Author: wuqingchun
 * @Date: 2024-10-09 15:38:46
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-10-11 19:51:01
 */
#ifndef __NETPERF_H__
#define __NETPERF_H__

#include <cstdint>
#include <netinet/in.h>

// 运行模式
typedef enum tagNetperfMode
{
    NETPERF_MODE_CLIENT,
    NETPERF_MODE_SERVER_ECHO,
    NETPERF_MODE_SERVER_DISCARD,
}NETPERF_MODE_E;

// 协议类型
typedef enum tagNetperfProto
{
    NETPERF_PROTO_TCP,
    NETPERF_PROTO_UDP,
}NETPERF_PROTO_E;

typedef struct tagNetperfMsgHead
{
    uint64_t ui64SeqNo;           // 消息序号
    int64_t i64TXTimeStamp;       // 发送时间戳
}NETPERF_MSG_HEAD_S;

// 运行参数
typedef struct tagNetperfParam
{
    NETPERF_MODE_E enMode;
    NETPERF_PROTO_E enProto;
    char szHost[64];
    uint16_t usPort;
    struct sockaddr_in stAddr;
    size_t ulPktLen;
    uint32_t uiPktCount;
    uint32_t uiInterval;
    uint32_t uiTimeout;
}NETPERF_PARAM_S;

#endif //__NETPERF_H__